/**
 * 认证相关API
 */

const request = require('../utils/request');

/**
 * 微信登录
 * @param {string} code - 微信登录code
 * @returns {Promise} 返回Promise对象
 */
const wxLogin = (code) => {
  return request.post('/auth/wxlogin', { code });
};

/**
 * 验证token是否有效
 * @returns {Promise} 返回Promise对象
 */
const verifyToken = () => {
  return request.get('/auth/verify');
};

/**
 * 退出登录
 * @returns {Promise} 返回Promise对象
 */
const logout = () => {
  return request.post('/auth/logout');
};

module.exports = {
  wxLogin,
  verifyToken,
  logout
};